package com.itheima.variable;

public class Demo4Operator {
    public static void main(String[] args) {
        //++在前,变量先自增 然后拿变量参与操作包括逻辑运算
        int a = 10;
        int b = ++a;

        System.out.println(a);//11
        System.out.println(b);//11

        //++在后 变量原本值参与操作,随后自增包括逻辑运算
        int aa = 10;
        int bb = aa++;
        System.out.println(aa);
        System.out.println(bb);

        int bbb = ++a + a++ + ++a - --a;
        System.out.println(bbb);


        int num = 123;
        System.out.println(num++);//123输出为123但之后num的值还是要增加1
        System.out.println(num);//124
        //System.out.println(10++);常量不能使用自增
    }

}
